//============================================================================
// Name        : medianFilter.cpp
// Author      : Kevin Yang
// Version     :
// Copyright   : Your copyright notice
// Description :
//============================================================================

#include <iostream>
#include <cstdlib>
#include "twoDimensionalPicture.h"
#include "filteredPicture.h"
using namespace std;

void insertionSort(int array[], int size);

int main() {

	filteredPicture filtPic;
	filtPic.generateRandomPicture();
	filtPic.medianFilterPicture();
	cout << "Print Original Picture" << endl;
	filtPic.printPicture();
	cout << "Print Padded Picture" << endl;
	filtPic.printPaddedPixels();
	cout << "Print Filtered Picture" << endl;
	filtPic.printFilteredPixels();

	// Check copy constructor for base
	twoDimensionalPicture pic1, pic2;
	pic1.generateRandomPicture();
	pic2 = pic1;
	cout << "pic1"<< endl;
	pic1.printPicture();
	cout << "pic2"<< endl;
	pic2.printPicture();

	filteredPicture filtPic2;
	filtPic2 = filtPic;
	cout << "Print Original Picture" << endl;
	filtPic2.printPicture();
	cout << "Print Padded Picture" << endl;
	filtPic2.printPaddedPixels();
	cout << "Print Filtered Picture" << endl;
	filtPic2.printFilteredPixels();
	return 0;
}

void insertionSort(int array[], int size){
	int current = 1;
	int temp;
	int walker;

	while (current < size){
		temp = array[current];
		walker = current -1;

		while ((walker >= 0) && (temp < array[walker])){
			array[walker+1] = array[walker];
			walker = walker-1;
		}
		array [walker+1] = temp;
		current = current + 1;
	}
}
